<template>
  <div class="app-container">
    <el-card>
      <div class="filter-container">
        <el-button type="primary" icon="el-icon-back" @click="$router.go(-1)">返回</el-button>
      </div>
      
      <el-descriptions title="签到详情" :column="2" border>
        <el-descriptions-item label="活动ID">{{ form.activityId }}</el-descriptions-item>
        <el-descriptions-item label="报名ID">{{ form.enrollmentId }}</el-descriptions-item>
        <el-descriptions-item label="签到时间">{{ parseTime(form.signTime) }}</el-descriptions-item>
        <el-descriptions-item label="创建时间">{{ parseTime(form.createTime) }}</el-descriptions-item>
      </el-descriptions>
    </el-card>
  </div>
</template>

<script>
import { getSign } from '@/api/secondclass/sign'

export default {
  data() {
    return {
      form: {}
    }
  },
  created() {
    const id = this.$route.params.id
    if (id) {
      this.getDetail(id)
    }
  },
  methods: {
    getDetail(id) {
      getSign(id).then(response => {
        this.form = response.data
      })
    },
    parseTime(time) {
      return this.$parseTime(time)
    }
  }
}
</script>